/*
 * @Author: your name
 * @Date: 2021-08-30 16:20:10
 * @LastEditTime: 2021-08-30 16:20:11
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \briup\5-javascript\day05\6-1数组去重.js
 */

function a() {

    arr = arr.sort(); //把数组进行排序
    var array = [arr[0]];
    for (var i = 1; i < arr.length; i++) {
        if (arr[i] !== arr[i - 1]) {
            array.push(arr[i]);
        }
    }
    return array;
}
var arr = [1, 1, 2, 3, 4, 3, 3, 5, 6, 4];
console.log(a(arr));